package com.parleys.android.server.controller;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public abstract class BaseController {

    protected List<Long> convertList(final List<?> fromList) {
        List<Long> toList = new ArrayList<Long>();
        
        for (Iterator<?> it = fromList.iterator(); it.hasNext(); ) {
        	Object obj = it.next();
            if (obj instanceof Long) {
                toList.add((Long) obj);
            } else if (obj instanceof Double) {
                toList.add(((Double) obj).longValue());
            }
        }

        return toList;
    }

}
